﻿@model mvcForum.Web.ViewModels.Create.CreateTopicViewModel
@using mvcForum.Web.Helpers;
@{
	ViewBag.Title = ForumHelper.GetString("CreateTopic.Title", new { Title = Model.Forum.Name });
	Layout = "~/areas/forum/views/shared/forumlayout.cshtml";
}
<!-- Views/Forum/CreateTopic.cshtml -->
@Html.Partial("Breadcrumb", Model.Path)
<a name="start_here"></a>
<h2>@Html.RouteLink(Model.Forum.Name, "ShowForum", new RouteValueDictionary { { "id", Model.ForumId }, { "title", Model.Forum.Name.ToSlug() } })</h2>
@using (Html.BeginForm("create", "topic", FormMethod.Post, new { enctype = "multipart/form-data" })) {
	@Html.HiddenFor(t => t.ForumId)
	<div class="panel" id="postingbox">
		<div class="block-header">
			<span><span></span></span>
		</div>
		<div class="block-content">
			<div class="block-inner">
				<h3>@ForumHelper.GetString("CreateTopic.PostNewTopic")</h3>
				<fieldset class="fields1">
					<dl style="clear: left;">
						<dt>@Html.LabelFor(t => t.Subject)</dt>
						<dd>@Html.TextBoxFor(t => t.Subject, new { @class = "inputbox autowidth", size = 45 })
							<!--<input type="text" name="subject" id="subject" size="45" maxlength="60" tabindex="2" value="" class="inputbox autowidth" />-->
						</dd>
					</dl>
					@if (Model.IsModerator) {
						<dl style="clear: left;">
							<dt>@Html.LabelFor(t => t.Type)</dt>
							<dd>@Html.DropDownListFor(t => t.Type, ForumHelper.GetTopicTypes(Model.Type), new { @class = "inputbox autowidth" })</dd>
						</dl>
	 }
	 else {
						@Html.HiddenFor(t => t.Type)
	 }
					<dl style="clear: left;">
						<dt>@Html.LabelFor(t => t.Body)</dt>
						<dd>@Html.Partial(ForumHelper.GetEditorString() + "Editor", String.IsNullOrEmpty(Model.Body) ? "" : Model.Body)</dd>
					</dl>
					@if (Model.CanUpload) {
@*						<dl style="clear: left;">
							<dt>@Html.LabelFor(t => t.AttachFile)</dt>
							<dd>@Html.CheckBoxFor(t => t.AttachFile)</dd>
						</dl>*@
						<dl style="clear: left;">
							<dt>@Html.LabelFor(t => t.AttachFile)</dt>
							<dd><input type="file" id="files" name="files" /></dd>
						</dl>
	 }
				</fieldset>
				<div class="block-clear"></div>
			</div>
		</div>
		<div class="block-footer">
			<span><span></span></span>
		</div>
	</div>	
	<div class="panel bg2">
		<div class="block-header">
			<span><span></span></span>
		</div>
		<div class="block-content">
			<div class="block-inner">
				<fieldset class="submit-buttons">
					<!--			<input type="submit" accesskey="k" tabindex="7" name="save" value="Save" class="button2" />&nbsp; 
			<input type="submit" tabindex="5" name="preview" value="Preview" class="button2" onclick="document.getElementById('postform').action += '#preview';" />&nbsp;
-->
					<input type="submit" accesskey="s" tabindex="6" name="post" value="@ForumHelper.GetString("CreateTopic.Submit")" class="button1 default-submit-action" />&nbsp;
				</fieldset>
				<div class="block-clear"></div>
			</div>
		</div>
		<div class="block-footer">
			<span><span></span></span>
		</div>
	</div>
}
@if (ForumHelper.Debug) {
<!-- For Selenium Test -->
<div id="forum_topic_create" style="display: none;"></div>
}